FROM gvenzl/oracle-xe:11

ADD container-entrypoint.sh /u01/app/oracle/
ADD run.sh /u01/app/oracle/
ADD instantclient /opt/instantclient/
ADD oracle /opt/oracle/oracle

ENV LD_LIBRARY_PATH=/opt/instantclient

USER root

RUN mkdir -p /usr/local/datakit/externals \
  && chown -R oracle:dba /usr/local/datakit/externals

USER oracle

ENTRYPOINT ["/u01/app/oracle/container-entrypoint.sh"]
